Offset-plus-delta ticking#697
Open
brentfpage wants to merge 1 commit intoepezent:masterfrom
Open
Conversation
a4d2d2f to
889173d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows for the tick labels on a given axis to be written as a small change (referred to below and in the code as a delta) relative to an offset. This presentation mode is only entered when the axis range=(max-min) is much less than the axis max and min. Specifically, the most significant digit of the axis range must be 3 decimal places to the right of the most significant digit of max(abs(max),abs(min)).
One thing that has to be considered for the mode is the maximum delta size relative to the range. If the maximum delta size is equal to the range, then the delta constantly cycles through 0 and the offset continually changes as the user pans around, which is hard to follow. On the other hand, if the maximum delta size is 1000 times the range, then it has to be written with ~5 sig figs for reasonable precision (range/100), which can lead to crowding. In the PR, the maximum delta size is configured to be between 10 and 100 times the range, avoiding both these issues.
If the delta is not close to 1, then it would have to be written with a bunch of zeros in the absence of any scaling, which would defeat the purpose of the ticking mode. So, the mode also includes a scaling by 10^(3n) such that the range is between 0.01 and 10 "label units".
The ticking mode in action:
:

I added this "compact" presentation mode because it's often required on smartphone screens